import argparse
import numpy as np
from utils.autoanchor import kmean_anchors


parser = argparse.ArgumentParser()
parser.add_argument('--nums', '-n', type=int, default=9, help='kmean anchors nums')
opt = parser.parse_args()
anchors_nums = opt.nums
result = kmean_anchors(path='./data/dataset.yaml', n=anchors_nums)

print(result)
result = np.round(result)
result.tolist()
print(result)
filename = 'kmean'+ str(anchors_nums) +'Anchors.txt'
with open(filename,'w+') as f:
    f.write(str(result))